import os
from datetime import datetime,timedelta

time='2020-10-24'
ht=[]
dict={}
while time !='2021-03-07':
    for name in os.listdir('D:\\Work\\Tool\\tiktok\\TikToks\\'):
        if not(name.endswith('.json')):
            continue
        if not(name.lower().startswith('hashtag')):
            continue
        fname=name.replace('.json','').split('_')
        if len(fname)>3:
            if fname[2]==time:
                if fname[3]=='t' :
                    if fname[1] not in ht:
                        ht.append(fname[1])
                elif int(fname[3])>0 and int(fname[3])<=15:
                    if fname[1] not in ht:
                        ht.append(fname[1])
    time=datetime.strftime(datetime.strptime(time,'%Y-%m-%d')+timedelta(days=1),'%Y-%m-%d')
# for item in ht:
#     print(item,dict[item])

print(ht)
print(len(ht))